package com.ehsy.statement;

import com.ehsy.common.ResponseVo;
import com.ehsy.model.UserInfo;
import com.ehsy.service.BaseRequestService;
import com.ehsy.service.BaseRequestService2;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.test.context.SpringBootTest;

import javax.annotation.Resource;

/**
 * @author YanZhen_Li
 * @version 1.0
 * @title A7接口注解
 * @description
 * @create 2024/6/18 10:49
 */
@SpringBootTest
        (webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
        properties = {"spring.config.location=classpath:application-test01.yml"})
public class A7接口注解 {
    @Resource
    BaseRequestService service1;
    @Resource
    BaseRequestService2 service2;

    /**
     * 接口注解@BaseRequest设置基础信息
     */
    @Test
    public void test001() {
        String test1 = service1.test1("西域智慧供应链");
        String test2 = service1.test2("西域智慧供应链");
        String test3 = service1.test3("张三丰");
        System.out.println(test1);
        System.out.println(test2);
        System.out.println(test3);
    }
    /**
     * 接口注解配置变量信息
     */
    @Test
    public void test002() {
        UserInfo userInfo = new UserInfo("张三", "18", "男", "上海", "13812341234", "123@qq.com", "123456");
        ResponseVo<UserInfo> test01 = service2.test01(userInfo);
        ResponseVo<UserInfo> test02 = service2.test02("www.mytest01.com:8080", userInfo);
        System.out.println(test01);
        System.out.println(test02);
    }
}
